package com.yuda.tools.authreport.config;

import com.aliyun.oss.ClientBuilderConfiguration;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Config {

    @Value("${spring.cloud.alicloud.access-key}")
    private String accessKey;

    @Value("${spring.cloud.alicloud.secret-key}")
    private String accessSecret;

    @Bean
    public OSS ossClientBeiJingInner() {
        ClientBuilderConfiguration config = new ClientBuilderConfiguration();
        config.setMaxConnections(5000);
        OSS build = new OSSClientBuilder().build("oss-cn-beijing-internal.aliyuncs.com", accessKey, accessSecret,config);
        return build;
    }
}
